# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-rich-argparse
_pkgname=rich_argparse
pkgver=1.7.0
pkgrel=1
pkgdesc='Rich help formatters for argparse and optparse.'
arch=('any')
url='https://github.com/hamdanal/rich-argparse'
license=('MIT')
depends=('python' 'python-rich' 'python-hatchling')
makedepends=('python-build' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6d6c5f422065cab2da90735ea7ba3ffb9614241866c848cf1dc327d0ac3521fb91ebd5f42a2b3777fc9446e82b675ec841659750132474854d33b15ebdf9d835')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

